<template>
  <div>
    <el-aside width="200px">
      <el-scrollbar>
        <h2>新闻系统</h2>
        <el-menu  :default-active="route.fullPath" class="el-menu-vertical-demo" :router="true">
         <el-menu-item index="/home">
            <el-icon><icon-menu /></el-icon>
            <span>首页</span>
          </el-menu-item>

          <el-sub-menu index="/nwelist">
            <template #title>
            <el-icon><location /></el-icon>
            <span>新闻资讯</span>
          </template>
            <el-menu-item-group>
              <el-menu-item index="/addlist">添加新闻</el-menu-item>
              <el-menu-item index="/newlist">新闻列表</el-menu-item>
            </el-menu-item-group>
          </el-sub-menu>
         
        </el-menu>
      </el-scrollbar>
    </el-aside>
  </div>
</template>

<script setup>
import {
  Document,
  Menu as IconMenu,
  Location,
  Setting,
} from '@element-plus/icons-vue'

import {useRoute} from 'vue-router'
const route=useRoute()
</script>

<style>
.el-menu-item-group__title{
    display: none;
}
h2{
    text-align: center;
    margin: 5px 0;
}
</style>